import java.util.Scanner;
public class Demo05 {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.println("输入年份");
    int year = sc.nextInt();
    System.out.println("输入月份");
    int month = sc.nextInt();
    System.out.println("输入日");
    int day = sc.nextInt();
    int res = 0;
    boolean isRunnian = (year % 4 == 0);
    switch (month) {
      case 12:
      res += 30;
      case 11:
      res += 31;
      case 10:
      res += 30;
      case 9:
      res += 31;
      case 8:
      res += 31;
      case 7:
      res += 30;
      case 6:
      res += 31;
      case 5:
      res += 30;
      case 4:
      res += 31;
      case 3:
      res += isRunnian?29:28;
      case 2:
      res += 31; 
      case 1:
      res += day;
    }
    System.out.println("今年的第" + res + '天');
  }
}